<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="contextPath"
	value="${pageContext.servletContext.contextPath}"></c:set>
<div class="row" style="background: #075885">
<div class="col-md-3">
	<c:choose>
		<c:when test="${currentUser == null}">
			<button type="button" class="btn btn-link " data-toggle="modal"
				data-target="#myModal">
				<font color="white" style="font-weight: bold;">请登录</font>
			</button>
			<button type="button" class="btn btn-link " data-toggle="modal"
				data-target="#add">注册</button>
		</c:when>
		<c:otherwise>
			<font color="white" style="font-weight: bold;">${currentUser.loginname}</font>
			<a href="${contextPath}/loginout.htm"><font color="white"
				style="font-weight: bold;">注销</font></a>
			<c:if test="${id !=1}">
				<ul id="nav" style="padding-left:600px;width:670px;">
					<li><font color="white" style="font-weight: bold;">书城菜单</font>
						<ul>
							<li><a href="${contextPath}/user/showcart.do">购物车</a></li>
							<li><a href="${contextPath}/showaccount.htm">我的账户</a></li>
						</ul></li>
				</ul>
			</c:if>
			<c:if test="${id == 1}">
				<ul id="nav" style="padding-left:600px;width:670px;">
					<li><font color="white" style="font-weight: bold;">管理员菜单</font>
						<ul>
							<li><a href="${contextPath}/admin.htm">管理员界面</a></li>
							<li><a href="${contextPath}/list.htm">主页</a></li>
							<li><a href="${contextPath}/user/showcart.do">购物车</a></li>
							<li><a href="${contextPath}/showaccount.htm">我的账户</a></li>
						</ul></li>
				</ul>
			</c:if>
		</c:otherwise>
	</c:choose>
</div>
</div>
<div class="row" >
	<img src="${contextPath}/img/115.jpg" />
</div>
<div class="modal fade" id="myModal" aria-labelledby="myModalLabel"
	aria-hidden="true" style="overflow-y: visible;">
	<div class="modal-dialog">
		<div class="modal-content" style="height: 320px">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="myModalLabel">登录窗口</h4>
			</div>
			<div class="modal-body"></div>
			<center>
				<form role="form" action="login.htm" method="post">
					<div class="form-group">
						用户名： <input type="text" class="form-control" placeholder="输入用户名"
							name="username" style="width: 300px;">
					</div>
					<div class="form-group">
						密 码： <input type="password" class="form-control"
							id="exampleInputPassword1" placeholder="输入密码" name="password"
							style="width: 300px;">
					</div>
					<button type="submit" class="btn btn-default"
						style="margin-top: 10px; height: 50px">登录</button>
				</form>
			</center>
		</div>
	</div>
</div>

<div class="modal fade" id="add" aria-labelledby="myModalLabel"
	aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content" style="height: 620px">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="myModalLabel">注册窗口</h4>
			</div>
			<div class="modal-body"></div>
			<center>
				<form role="form" action="adduser.htm" method="get" name="addform">
					<div class="form-group">
						用户名： <input type="text" class="form-control" placeholder="注册用户名"
							name="name" style="width: 300px;" />
					</div>
					<div class="form-group">
						密 码： <input type="password" class="form-control"
							id="exampleInputPassword1" placeholder="注册密码" name="password1"
							style="width: 300px;" onKeyUp="pwStrength(this.value)"
							onBlur="pwStrength(this.value)" /> 密码强度:
						<table width="210" border="1" cellspacing="0" cellpadding="1"
							bordercolor="#eeeeee" height="22" style='display: inline'>
							<tr align="center" bgcolor="#f5f5f5">
								<td width="33%" id="strength_L">弱</td>
								<td width="33%" id="strength_M">中</td>
								<td width="33%" id="strength_H">强</td>
							</tr>
						</table>
					</div>
					<div class="form-group">
						确认密码： <input type="password" class="form-control"
							id="exampleInputPassword1" placeholder="再次输入密码" name="password2"
							style="width: 300px;" onclick="check()" />
					</div>
					<div class="form-group">
						年 龄: <input type="text" class="form-control" name="age"
							placeholder="年龄" style="width: 300px;" />
					</div>
					<div class="form-group">
						E-mail: <input type="mail" class="form-control" name="email"
							id="email" placeholder="注册邮箱" style="width: 300px;" />
					</div>
					<div class="form-group">
						性 别: <input type="radio" name="sex" value="male" /> Male <input
							type="radio" name="sex" value="female" /> Female
					</div>
					<button type="submit" class="btn btn-default"
						style="margin-top: 10px; height: 50px">注册</button>
				</form>
			</center>
		</div>
	</div>
</div>
